//2009/08/28 11:00:26
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class ReadingBooks
{
public:
    int countBooks(vector <string> readParts)
    {
        int ret = 0;
        for (int i=0; i+2<readParts.size(); )
            if (readParts[i]!=readParts[i+1] && readParts[i]!=readParts[i+2] && readParts[i+1]!=readParts[i+2])
                ret++, i+=3;
            else i++;
        return ret;
    }
};
